package com.baofang.bao.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baofang.bao.entity.IndustryNews;
import com.baofang.bao.repository.IndustryNewsRepository;
@Service
public class IndustryNewsServiceImpl implements IindustryNewsService {
	@Autowired
	private IndustryNewsRepository industrynewsrepository; 
	
	public List<IndustryNews> getUsers(){
		return industrynewsrepository.findAll();
	}
	
	public IndustryNews getUserById(Long id) {
		return industrynewsrepository.getOne(id);
	}
	
	public IndustryNews saveUser(IndustryNews industryNews) {
		return industrynewsrepository.saveAndFlush(industryNews);
	}
}
